package cn.hanna.spingcloud.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

/**
 * @author smileha
 * @create 2021-10-17 10:19
 * @description
 */
@RestController
public class OrderConsulController {
    private String PAYMENT_URI = "http://consul-payment-service";
    @Autowired
    private RestTemplate restTemplate;

    @GetMapping("/consumer/payment/consul")
    public String paymentInfo(){
        return restTemplate.getForObject(PAYMENT_URI+"/payment/consul",String.class);
    }
}
